/*
 * @Description: 公共头部AppBar，自定义AppBar AppbarCustomWidget
 * @version: 
 * @Company: 
 * @Author: ZhengZhuang
 * @Date: 2019-08-21 17:38:44
 * @LastEditors: ZhengZhuang
 * @LastEditTime: 2019-08-23 12:01:21
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class AppbarCustomWidget extends StatefulWidget implements PreferredSizeWidget {
  final Widget child;
  AppbarCustomWidget({this.child});
  @override
  State<AppbarCustomWidget> createState() => _AppbarCustomWidgetState();

  @override
  Size get preferredSize {
    return new Size.fromHeight(56.0);
    // return new Size.fromHeight(46.0);
  }
}

class _AppbarCustomWidgetState extends State<AppbarCustomWidget> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return new Container(
      color: Color.fromARGB(255, 78, 79, 95),
      width: ScreenUtil().setWidth(750),
      child: Container(
          margin: EdgeInsets.only(top: 20.0),
          alignment: Alignment.centerLeft,
          child: widget.child),
    );
  }
}
